#ifndef IMAGE_PLOT_H_
#define IMAGE_PLOT_H_

/**
 * @file ImagePlot.h
 */

#include "ImagePlotData.h"

#include <qwt_interval.h>
#include <qwt_plot_spectrogram.h>

namespace spectrum {

/**
 * @class ImagePlot
 *
 * @brief
 * Image plot type class for use with QWT.
 *
 * @details
 */

class ImagePlot : public QwtPlotSpectrogram
{
    public:
        /// Constructs an image plot object.
        ImagePlot() {};

        /// Destroys an image plot object.
        virtual ~ImagePlot() {}

    public:
        /// Set Image plot data.
        void setImageArray(const float * data, unsigned nx, unsigned ny,
                double xmin, double xmax, double ymin, double ymax);

        /// Set the amplitude range to auto.
        void setAmpRangeAuto();

        /// Show contours on the image plot.
        void showContours(const bool on);

        /// Set the image display mode.
        void setDisplayImage(const bool on);

        /// Setup contour levels.
        void setupContours(const unsigned nLevels);

        /// Returns the amplitude range.
        QwtInterval& ampRange() { return _range; }

        /// Returns the amplitude range (const overload).
        const QwtInterval& ampRange() const { return _range; }

        /// Returns a const pointer to the image plot data.
        const ImagePlotData * getData() const { return &_data; }

    private:
        ImagePlotData _data;        ///< Image plot data object.
        QwtInterval _range;   ///< Image plot amplitude range.
};

} // namespace spectrum
#endif // IMAGE_PLOT_H_
